{template 'header'}
<div class="m">
<div class="left_box">		
		<div class="pos">当前位置: <a href="{$MODULE[1][linkurl]}">首页</a> &raquo; <a href="{$MOD[linkurl]}">{$MOD[name]}</a> &raquo; {cat_pos($CAT, ' &raquo; ')} &raquo;</div>
		<div class="b10 c_b"></div>
		<table width="100%">
		<tr>
		<td width="10"> </td>
		<td>
			<table width="100%">
			<tr>
			<td colspan="3"><h1 class="title_trade">{$title}</h1></td>
			</tr>
			<tr>
			<td width="250" valign="top">
				<div class="album">
					<table width="100%" cellpadding="0" cellspacing="0">
					<tr align="center">
					<td width="250" valign="top"><div><span id="abm" title="点击查看大图"><img src="{$albums[0]}" onload="if(this.width>240){this.width=240;}" onmouseover="SAlbum(this.src);" onmouseout="HAlbum();" onclick="PAlbum(this);" id="DIMG"/></span></div></td>
					</tr>
					<tr>
					<td>
					{loop $thumbs $k $v}<img src="{$v}" width="60" height="60" onmouseover="if(this.src.indexOf('nopic60.gif')==-1)Album({$k}, '{$albums[$k]}');"class="{if $k}ab_im{else}ab_on{/if}" id="t_{$k}"/>{/loop}</td>
					</tr>
					<tr align="center">
					<td height="30" onclick="PAlbum(Dd('DIMG'));"><img src="{DT_SKIN}image/ico_zoom.gif" width="16" height="16" align="absmiddle"/> 点击图片查看原图</td>
					</tr>
					</table>
				</div>
			</td>
			<td width="15"> </td>
			<td valign="top">
				<div id="imgshow" style="display:none;"></div>
				<table width="100%" cellpadding="5" cellspacing="5">
				<tr>
				<td class="f_dblue">单 价：</td>
				<td class="f_gray">￥<span class="f_price px16">{$price}</span></td>
				</tr>
				<tr>
				<td class="f_dblue">品 牌：</td>
				<td>{if $brand}<a href="{$MOD[linkurl]}search.php?fields=4&kw={urlencode($brand)}" target="_blank">{$brand}</a>{else}未填写{/if}</td>
				</tr>
				<tr>
				<td class="f_dblue">所在地：</td>
				<td>{area_pos($areaid, '')}</td>
				</tr>
				<tr>
				<td class="f_dblue">销 量：</td>
				<td><a href="#order" onclick="Mshow('order');">累计出售 <span class="f_orange">{$sales}</span> 件，{$orders} 个订单</a></td>
				</tr>
				<tr>
				<td class="f_dblue">评 价：</td>
				<td><a href="#comment" onclick="Mshow('comment');">已有 <span class="f_orange">{$comments}</span> 条评价</a></td>
				</tr>
				<tr>
				<td class="f_dblue">库 存：</td>
				<td>还剩 <span class="f_orange">{$amount}</span> 件</td>
				</tr>
				<tr>
				<td width="50" class="f_dblue">人 气：</td>
				<td>已有 <span class="f_orange"><span id="hits">{$hits}</span></span> 人关注</td>
				</tr>
				<tr>
				<td class="f_dblue">更 新：</td>
				<td>{$editdate}</td>
				</tr>
				{if $status == 3}
				<tr>
				<td colspan="2">
				<div id="cart_tip" style="display:none;">
					<p><img src="{DT_SKIN}image/close.gif" alt="关闭" width="17" height="12" onclick="Dh('cart_tip');"/>提示信息</p>
					<div>已成功添加到购物车！购物车里已有 <span id="cart_num">0</span> 种商品</div>
					<center>
					<input type="button" value="再逛逛" onclick="Dh('cart_tip');"/>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="button" value="去结算" onclick="Go('{$MOD[linkurl]}cart.php');"/>
					</center>
				</div>
				<img src="{DT_SKIN}image/btn_tobuy.gif" alt="立即购买" class="c_p" onclick="Go('{$MOD[linkurl]}{rewrite('buy.php?itemid='.$itemid)}');"/>
				&nbsp;
				<img src="{DT_SKIN}image/btn_addcart.gif" alt="加入购物车" class="c_p" onclick="AddCart({$itemid});"/>
				</td>
				</tr>
				{else}
				<tr>
				<td></td>
				<td><strong class="f_red">该商品已下架</strong></td>
				</tr>				
				{/if}
				</table>
			</td>
			</tr>
		</table>
		</td>
		<td width="10"> </td>
		<td width="300" valign="top">		
			<div class="contact_head">公司基本资料信息</div>
			<div class="contact_body" id="contact">{template 'contact', 'chip'}</div>
			{if !$username}
			<br/>
			&nbsp;<strong class="f_red">注意</strong>:发布人未在本站注册，建议优先选择<a href="{$MODULE[2][linkurl]}grade.php"><strong>{VIP}会员</strong></a>
			{/if}
			</div>
		</td>
		<td width="10"> </td>
		</tr>
		</table>
		<div class="b10">&nbsp;</div>
</div>
</div>


<div class="m">
	<div class="b10">&nbsp;</div>
	<div class="mall_t">
		<ul>
		<li class="mall_tab_2" id="t_detail"><a href="#detail" onclick="Mshow('detail');">商品详情</a></li>
		<li class="mall_tab_1" id="t_comment"><a href="#comment" onclick="Mshow('comment');">评价详情({$comments})</a></li>
		<li class="mall_tab_1" id="t_order"><a href="#order" onclick="Mshow('order');">交易记录({$orders})</a></li>
		</ul>
		<a name="detail"></a><a name="comment"></a><a name="order"></a><div class="t_c"></div>
	</div>
	<div class="mall_c" style="display:;" id="c_detail">
		{if $CP}{template 'property', 'chip'}{/if}
		<div class="content c_b" id="content">{$content}</div>
	</div>
	<div class="mall_c" style="display:none;" id="c_comment">
		<center>正在载入评论详细...</center>
	</div>
	<div class="mall_c" style="display:none;" id="c_order">
		<center>正在载入交易记录...</center>
	</div>
</div>

<div class="m">
	<form method="post" action="{$MODULE[2][linkurl]}sendmail.php" name="sendmail" id="sendmail" target="_blank">
	<input type="hidden" name="itemid" value="{$itemid}"/> 
	<input type="hidden" name="title" value="{$title}"/>
	<input type="hidden" name="linkurl" value="{$linkurl}"/>
	</form>
	<br/>
	<center>
	[ <a href="{$MOD[linkurl]}search.php">商品搜索</a> ]&nbsp;
	[ <script type="text/javascript">addFav('加入收藏');</script> ]&nbsp;
	[ <a href="javascript:Dd('sendmail').submit();void(0);">告诉好友</a> ]&nbsp;
	[ <a href="javascript:Print();">打印本文</a> ]&nbsp;
	[ <a href="javascript:window.close()">关闭窗口</a> ]
	</center>
	<br/>
</div>
{template 'zoom', 'chip'}
<script type="text/javascript">
function AddCart(i) {
	makeRequest('action=ajax&itemid='+i, '{$MOD[linkurl]}cart.php', '_AddCart');
}
function _AddCart() {
	if(xmlHttp.readyState==4 && xmlHttp.status==200) {
		if(xmlHttp.responseText == -3) {alert('商品不存在或已下架');return;}
		if(xmlHttp.responseText == -4) {alert('不能添加自己的商品');return;}
		var cart_num = substr_count(get_cookie('cart'), ',');
		Dd('cart_num').innerHTML = cart_num;
		if(cart_num) Dd('destoon_cart').innerHTML = '<strong class="f_red">'+cart_num+'</strong>';
		Ds('cart_tip');
	}
}
var c_c = Dd('c_comment').innerHTML;
var c_o = Dd('c_order').innerHTML;
var n_c = {$comments};
var n_o = {$orders};
function Mshow(i) {
	if(i == 'detail') {
		Dd('t_detail').className = 'mall_tab_2';
		Dd('t_comment').className = 'mall_tab_1';
		Dd('t_order').className = 'mall_tab_1';
		Ds('c_detail');
		Dh('c_comment');
		Dh('c_order');
	} else if(i == 'comment') {
		Dd('t_detail').className = 'mall_tab_1';
		Dd('t_comment').className = 'mall_tab_2';
		Dd('t_order').className = 'mall_tab_1';
		Dh('c_detail');
		Ds('c_comment');
		Dh('c_order');
		load_comment(0);
	} else if(i == 'order') {
		Dd('t_detail').className = 'mall_tab_1';
		Dd('t_comment').className = 'mall_tab_1';
		Dd('t_order').className = 'mall_tab_2';
		Dh('c_detail');
		Dh('c_comment');
		Ds('c_order');
		load_order(0);
	}
}
function load_comment(p) {
	if(n_c == 0) {
		Dd('c_comment').innerHTML = '<div class="comment_no">暂无评论</div>';
		return;
	}
	if(p == 0 && Dd('c_comment').innerHTML != c_c) return;
	makeRequest('action=comment&itemid={$itemid}&page='+p, '{$MOD[linkurl]}api.php', '_load_comment');
}
function _load_comment() {
	if(xmlHttp.readyState==4 && xmlHttp.status==200) {
		Dd('c_comment').innerHTML= xmlHttp.responseText;
	}
}
function load_order(p) {
	if(n_o == 0) {
		Dd('c_order').innerHTML = '<div class="order_no">暂无交易</div>';
		return;
	}
	if(p == 0 && Dd('c_order').innerHTML != c_o) return;
	makeRequest('action=order&itemid={$itemid}&page='+p, '{$MOD[linkurl]}api.php', '_load_order');

}
function _load_order() {
	if(xmlHttp.readyState==4 && xmlHttp.status==200) {
		Dd('c_order').innerHTML= xmlHttp.responseText;
	}
}
/* var url = window.location.href; */
if(window.location.href.indexOf('#') != -1) {
	var t = window.location.href.split('#');
	try {Mshow(t[1]);} catch(e) {}
}
</script>
{template 'footer'}